/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.admin.service;

import org.springblade.core.log.exception.ServiceException;
import org.springblade.modules.admin.dto.RescueNoticeCreateDTO;
import org.springblade.modules.admin.dto.RescueRoomPersonDTO;
import org.springblade.modules.admin.dto.rescue.GroupAINoticeCreateDTO;
import org.springblade.modules.admin.dto.rescue.RescueNoticeListDTO;
import org.springblade.modules.admin.entity.RescueNotice;
import org.springblade.modules.admin.vo.CurRescueNoticeVO;
import org.springblade.modules.admin.vo.RescueNoticeStatisticsVO;
import org.springblade.modules.admin.vo.RescueNoticeVO;
import org.springblade.core.mp.base.BaseService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.admin.vo.rescue.ExistRescuePlanVO;
import org.springblade.modules.admin.vo.rescue.RescueNoticeDetailVO;
import org.springblade.modules.admin.vo.rescue.RescueNoticeListVO;

import java.util.List;

/**
 * 救援通知记录表 服务类
 *
 * @author ysq
 * @since 2023-09-14
 */
public interface IRescueNoticeService extends BaseService<RescueNotice> {

	/**
	 * 重复通知缓存key
	 */
	String NOTICE_KEY = "rescue:deduplication:notice";

	/**
	 * 自定义分页
	 *
	 * @param page 分页信息
	 * @param rescueNotice 查询参数
	 * @return 分页结果
	 */
	IPage<RescueNoticeVO> selectRescueNoticePage(IPage<RescueNoticeVO> page, RescueNoticeVO rescueNotice);

	/**
	 * 救援通知添加
	 * @param rescueNoticeCreate 梯联网通过MQ传来的参数
	 */
	Long rescueNoticeSave(RescueNoticeCreateDTO rescueNoticeCreate) throws ServiceException;

	/**
	 * 微信群创建告警信息
	 * @param groupAINoticeCreateDTO
	 * @return
	 */
	Long createRescueNoticeFromGroup(GroupAINoticeCreateDTO groupAINoticeCreateDTO);

	/**
	 * 救援通知会话添加
	 * @param rescueRoomPerson 参数
	 */
	void rescueNoticeSessionSave(RescueRoomPersonDTO rescueRoomPerson);

	/**
	 * 统计
	 * @return 统计结果
	 */
    RescueNoticeStatisticsVO statistics();

	/**
	 * 紧急呼救列表
	 * @return List 列表结果
	 */
	List<CurRescueNoticeVO> curRescueNoticeList(String tenantId);

	/**
	 * 救援告警查询列表
	 * @return 分页结果
	 */
	IPage<RescueNoticeListVO> getNoticeListByCondition(IPage<RescueNoticeListVO> page, RescueNoticeListDTO rescueNoticeListDTO);

	/**
	 * 救援告警详情VO
	 * @param rescueNoticeId 救援告警id
	 * @return 返回详情对象
	 */
	RescueNoticeDetailVO getNoticeDetailById(Long rescueNoticeId);

	/**
	 * 未完成的救援工单
	 * @param elevatorId 电梯id
	 * @return 返回进行中工单列表
	 */
    List<ExistRescuePlanVO> existRescueNoticeList(Long elevatorId);

}
